import ReactDOM from 'react-dom/client';
import '@ant-design/v5-patch-for-react-19';
import AppRoute from '@/routes';
import '@/assets/reset.less';
import './index.css';
import WujieReact from "wujie-react";
import dayjs from 'dayjs';

window.dayjs = dayjs;
const { setupApp, preloadApp } = WujieReact;

const rootEl: any = document.getElementById('root');
const root = ReactDOM.createRoot(rootEl);
root.render(<AppRoute />);

console.log(dayjs().format('YYYY-MM-DD HH:mm:ss') + ' 主应用启动成功');

setupApp({
  name: "opt",
  url: "//localhost:5201/",
  exec: true, // 开启预加载和预执行
  sync: true, // 开启路由同步
});

setupApp({
  name: "crm",
  url: "//localhost:5202/",
  exec: true, // 开启预加载和预执行
  sync: true, // 开启路由同步
});

preloadApp({
  name: "opt",
  url: "//localhost:5201/",
  exec: true, // 开启预加载和预执行
});